package com.insurance.mapper;

import com.insurance.common.ResultData;
import com.insurance.pojo.PayInfo;
import com.insurance.pojo.Refund;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: 朱雄
 * Date: 2020/10/31 17:21
 * Description:
 * Version: V1.0
 */
public interface OrderPayMapper {

    int payOrder(PayInfo payInfo);

    int updateOrderStartu(String orderNumber);

    int refundOrder(PayInfo payInfo);

    int updateRefundOrderStartu(String orderNumber);

    List<Map> queryRefundOrder(@Param("orderStart") Integer orderStart);

    int addApplyRefundByOrder(Refund refund);

    int addRefundOrderStartu(Refund refund);

    ResultData updateSuceessPayOrder(PayInfo payInfo);
    /**
     * 退款驳回
     * @param refund
     * @return
     */
    int noAgreeExitPayOrder(Refund refund);

    /**
     * 驳回后修改，订单状态
     * @param refund
     * @return
     */
    int noAgreerejectRefund(Refund refund);

    /**
     * 避免驳回后重新提交，表中数据重复，先删除
     * @param refund
     * @return
     */
    int deleteRefundByOrder(Refund refund);

    /**
     * 通过支付id查询司机
     * @param order_number
     * @return
     */
    Map queryDriverInfo(@Param("order_number") String order_number);

    /**
     * 用户支付成功后删除优惠券
     *
     * @param couponId
     * @param user_id
     * @return
     */
    int deleteCoupon(@Param("couponId") Integer couponId,@Param("user_id") Integer user_id);

    /**
     * 修改成功
     * @param payInfo
     * @return
     */
    int paySuceessOrder(PayInfo payInfo);
}
